
function BootstrapController(home){
	this.home = home;
	this.data = {};
	var that = this; // for use in closures and callbacks where this changes depending on the context
	
	if(typeof BootstrapController.prototype.load == "undefined"){	 
		BootstrapController.prototype.load = function() {
	        home.beforeAjax();
		    var that = this;

	        var jqXHR_getTemplate = {};
	        if(typeof $.template["compiled_bootstrap_template"] == "undefined"){
	        	jqXHR_getTemplate = $.get('/template/bootstrap.html', function(templateData) {
	        		$.template("compiled_bootstrap_template", templateData );
	        	});
	        }
	        var options = {
              'success': function (data) { 
                  console.log("success data: " + JSON.stringify(data));
                  that.data = data;
              },
              'type' : "POST",
              'data' : 'load=true'
	        };
	        var jqXHR = new AjaxHelper(options).getJSON("/locTypePutCreate.app");
			
	        var deferred = $.when( jqXHR, jqXHR_getTemplate);
	        deferred.done(function(){
	        	$(".fap_container_class").hide().empty();
				$("#bootstrap_container_id").show();
	            $.tmpl("compiled_bootstrap_template", that.data).appendTo( "#bootstrap_container_id" );
	        });
	        deferred.always(function(){
	        	home.afterAjax();
	        });
		}
		
	}
}

